package com.xingyue.loginqueryarticle.Dao;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class PageDao implements Serializable {

private  int totalNum; //总数量

    private  int pageSize=4; //每页数量

       private  int totalPage; //总页数

          private  int currentPage; //当前在那一页

               private List data=new ArrayList(); //当前这页数据

    public int countPage(int count){
        //计算总页数 :    总页数count /每页数量pageSize  余数进一方法：Math.ceil   int 强转float小数进一计算
        totalPage = (int)Math.ceil(count/((float)pageSize));
        return totalPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {

        this.pageSize = pageSize;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totaPage) {
        this.totalPage = totaPage;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }

    public int getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(int totalNum) {
        this.totalNum = totalNum;
    }
}
